Push Notifications - Kafka
Use Apache Kafka with Downstream Message Push (DMP) when OIPA must send an activity message to one or more downstream applications without calling each application directly.
Kafka stores messages in named channels, called topics. OIPA sends a message to a topic. Downstream applications read the message from that topic when they are ready.
This topic describes the Kafka-specific DMP configuration. For the `PushNotifications` XML structure, message templates, and transaction math variables, see the XML Configuration Guide.
How Kafka Works with DMP
When an activity reaches the DMP point in processing, OIPA does the following:
-
OIPA evaluates the attached `PushNotifications` rule.
-
If the configured test passes, OIPA creates the XML message from the configured templates.
-
OIPA finds the outbound application record that matches the `PushNotification/@EVENTNAME` value and the `downstream.service.event.mode` value.
-
OIPA sends the XML message to the configured Kafka topic. OIPA uses the message GUID as the Kafka record key. If the message GUID is unavailable, OIPA uses the message ID.
-
OIPA waits for Kafka to confirm that it stored the message according to the configured acknowledgement setting.
-
OIPA records a successful or failed outbound push and applies the configured `OnPushFailure` behavior.
Kafka provides confirmation that it accepted and stored the message. Kafka does not confirm that every downstream application has read or processed the message.
Before You Begin
Complete the following tasks before you configure OIPA:
-
Ask the Kafka administrator to create the Kafka cluster and the target topic.
-
Get the topic name and one or more Kafka bootstrap server addresses.
-
Ensure that the OIPA runtime host can reach the Kafka broker advertised listener address and port.
-
Ask the Kafka administrator to create the OIPA producer credential and grant it Write and Describe permissions for the topic.
-
For `SASL_SSL`, get the Kafka broker public certificate or the issuing CA certificate.
-
For OAuth bearer authentication, get the OAuth provider HTTPS certificate or CA certificate if OIPA uses the same outbound trust context to request an OAuth token.
Import only public certificates or CA certificates into OIPA. Do not copy Kafka or OAuth private keys to OIPA.
Configure the Kafka Outbound Application
Create an outbound application record and an outbound security record through the supported Outbound Applications interface. Kafka does not use a `DownstreamMessagePushDefinition` XML event. Do not add a Kafka `<Event>` to the `DownstreamMessagePushDefinition` system rule.
Instead, OIPA selects the Kafka destination by matching these values:
| OIPA Configuration | Matching Value |
|---|---|
| PushNotification/EVENTNAME | OutboundApplications.eventName |
| Downstream.service.event.mode | OutboundApplications.environment |
| Transport | OutboundApplications.protocolType=KAFKA |
Configure the following fields in the outbound application record.
| Field | Required | Description |
|---|---|---|
|
eventName |
Yes |
The event name in the PushNotifications rule, for example Billing. |
|
environment |
Yes |
The environment in downstream.service.event.mode, for example Development or Production. |
|
protocolType |
Yes |
Set the value to KAFKA. |
|
bootstrapServers |
Yes |
A comma-separated list of Kafka broker addresses. Use multiple addresses in production. |
|
topicName |
Yes |
The Kafka topic that receives the OIPA message. |
| deliveryMode | Yes | Mandatory inside outboundConfiguration. Only SYNC is supported. Missing/empty or unknown values are rejected; ASYNC is rejected with an explanation that it is not yet available. |
|
acks |
Recommended Optional; effective all required |
The Kafka acknowledgement setting. Use all for durable delivery. Omitted defaults to all. all (case-insensitive) and -1 are accepted. 0 and 1 are rejected for synchronous Kafka publishing. |
|
maxTimeOut |
Configure Optional |
The maximum time, in milliseconds, that OIPA waits for the Kafka send to complete. Synchronous acknowledgment deadline in milliseconds: 1000–15000 when supplied; omitted defaults to 15000. Located on outboundApplications, not inside outboundConfiguration. The wait uses the remaining time after setup and send(). |
|
clientId |
No |
A producer name that appears in Kafka logs and metrics. |
|
securityProtocol |
Yes |
Set the value to SASL_SSL or SASL_PLAINTEXT. OIPA does not support PLAINTEXT or SSL-only Kafka connections for outbound publishing. |
|
saslMechanism |
Yes |
Set the value to PLAIN, SCRAM-SHA-256, SCRAM-SHA-512, or OAUTHBEARER. |
|
oauthTokenEndpointUrl |
OAuth only |
The OAuth token address that OIPA uses for client-credentials authentication. |
XML Example: SASL_SSL with SCRAM-SHA-512
{"outboundApplications": {"eventName": "Billing",
"environment": "Development",
"protocolType": "KAFKA",
"outboundConfiguration": {"bootstrapServers": "broker1.example.com:9099,broker2.example.com:9099",
"topicName": "DownstreamMessagePushTopic",
"acks": "all",
"clientId": "oipa-push-notifications-billing",
"securityProtocol": "SASL_SSL",
"saslMechanism": "SCRAM-SHA-512",
"deliveryMode": "SYNC"
},
"maxTimeOut": "10000",
"outboundSecurity": {"authType": "BASIC",
"authentication": {"userName": "oipa-producer",
"password": "<producer-password>"
}
}
}
}
XML Example: SASL_SSL with OAuth Bearer
{"outboundApplications": {"eventName": "Billing",
"environment": "Production",
"protocolType": "KAFKA",
"outboundConfiguration": {"bootstrapServers": "broker1.example.com:9100,broker2.example.com:9100",
"topicName": "DownstreamMessagePushTopic",
"acks": "all",
"clientId": "oipa-push-notifications-oauth",
"securityProtocol": "SASL_SSL",
"saslMechanism": "OAUTHBEARER",
"oauthTokenEndpointUrl": "https://oauth.example.com/realms/oipa/protocol/openid-connect/token",
"deliveryMode": "SYNC"
},
"maxTimeOut": "10000",
"outboundSecurity": {"authType": "OAUTH_CLIENT_CREDENTIALS",
"authentication": {"clientId": "oipa-kafka-producer",
"clientSecret": "<client-secret>"
}
}
}
}
Configure Security
For `PLAIN`, `SCRAM-SHA-256`, and `SCRAM-SHA-512`, set `outboundSecurity.authType` to `BASIC`. Then provide the Kafka user name and password.
For `OAUTHBEARER`, set `outboundSecurity.authType` to `OAUTH_CLIENT_CREDENTIALS`. Then provide the OAuth client ID and client secret.
Use the following security profiles.
| Security protocol | SASL Mechanism | Use |
|---|---|---|
|
SASL_SSL |
OAUTHBEARER |
Recommended for production and cloud deployments. |
|
SASL_SSL |
SCRAM-SHA-512 |
Recommended for secure test environments and suitable when OAuth is unavailable. |
|
SASL_SSL |
SCRAM-SHA-256 or PLAIN |
Supported. Prefer SCRAM-SHA-512. Use PLAIN only for testing. |
|
SASL_PLAINTEXT |
SCRAM-SHA-512 or SCRAM-SHA-256 |
Use only on an isolated internal development or test network. |
|
SASL_PLAINTEXT |
PLAIN or OAUTHBEARER |
Use only for local or isolated testing. Kafka does not encrypt the traffic. |
OIPA encrypts the BASIC password or OAuth client secret before it stores the value. If OIPA cannot encrypt a credential when you create or update an outbound application, it fails the operation. OIPA does not store a plaintext fallback. Do not log credentials, decrypted values, OAuth tokens, or key-management material.
Configure the OIPA Runtime
Set the DMP environment in `PAS.properties`. The value must match the outbound application `environment` value.
downstream.service.event.mode=Development jmx.notification.entities=cycle,login,activity,activityprofiling,outboundeventpush |
For `SASL_SSL`, import the Kafka broker public certificate or CA certificate into the OIPA outbound truststore. A truststore is a file that contains certificates OIPA trusts. Set the truststore location in `PAS.properties` and set the truststore password as a server environment variable.
outbound.trustStore=<truststore-path> outbound.serviceProtocol=TLS |
Set the following server environment variable:
outbound.trustStorePassword=<truststore-password> |
outbound.serviceProtocol is optional and defaults to TLS. Restart the OIPA application server after you change the truststore, `PAS.properties`, or the environment variable.
For a container deployment, provide the truststore through the approved secret or volume mechanism. Store the truststore password in `pas_env.dat` by using the approved secret value. Do not put passwords, private keys, or client secrets in a container image, source control, or `PAS.properties`.
Configure PushNotifications
Use the standard PushNotifications attached business rule. Kafka does not add new XML elements to the rule. The `EVENTNAME` value selects the matching Kafka outbound application record.
<PushNotifications>
<PushNotification EVENTNAME="Billing">
<Message ID="BillingMsg1">
<Tests>
<Test>1=1</Test>
</Tests>
<AsEventMessage xmlns="http://xmlns.alamere.com/PAS/AsEventMessage">
<JSTLMessage>
<Parameters>
<Parameter DATATYPE="TEXT" NAME="payerName">payerName</Parameter>
<Parameter DATATYPE="BOOLEAN" NAME="isReBill">isReBill</Parameter>
</Parameters>
<Billing>
<payerName>[payerName]</payerName>
<isReBill>[isReBill]</isReBill>
</Billing>
</JSTLMessage>
</AsEventMessage>
</Message>
</PushNotification>
<OnPushFailure>
<RollbackTransaction>Yes</RollbackTransaction>
<CreateBusinessError>Yes</CreateBusinessError>
</OnPushFailure>
</PushNotifications>
Define all referenced math variables and activity fields in the transaction XML. Attach the PushNotifications rule to the transaction. Do not add PushNotifications to `TransactionBusinessRulePacket`; OIPA processes the rule after core activity processing and before database commit preparation.
Configure Delivery and Failure Handling
Synchronous OIPA Kafka publishing always uses effective acks=all. Omit acks or supply all/-1; 0 and 1 are rejected. Broker-side min.insync.replicas and the current ISR determine write availability and durability. For a local test that uses one Kafka server, set the topic replication factor to 1. For production, use at least three Kafka servers and set the topic replication factor to 3.
Set min.insync.replicas so that the loss of one Kafka server does not reduce the intended protection level. For a replication factor of 3, a common value is 2.
If Kafka is unavailable, authentication fails, the producer lacks permission, the certificate is not trusted, or Kafka cannot meet the acknowledgement requirement, OIPA treats the push as a failure. OIPA then applies the existing OnPushFailure settings:
| Setting | Result |
|---|---|
| RollbackTransaction=Yes | OIPA rolls back the activity. |
| CreateBusinessError=Yes | OIPA creates a business error on the activity. |
Monitor and Verify the Kafka Message
OIPA updates the PushNotifications activity XML with `Status=Success` when it publishes the message successfully. If the push fails, OIPA records the failure and applies `OnPushFailure`.
Use outboundeventpush in jmx.notification.entities to view outbound push information in the Admin Console or Java Management Extensions (JMX). The DMP monitoring data includes the Kafka destination metadata. The Admin Console AcOutboundEvent table records the outbound message lifecycle.
Verify the Configuration:
1. Confirm that the Kafka topic exists and that the OIPA producer has Write and Describe permissions.
2. Start an authorized Kafka consumer for the topic and display the record key. The consumer needs topic Read and Describe permissions and consumer-group Read permission.
3. Process an OIPA activity that meets the PushNotifications test condition.
4. Confirm that the consumer receives the XML message and that OIPA records a successful outbound push.
5. Test failure handling by removing the producer Write permission or making Kafka unavailable. Confirm that OIPA applies the configured OnPushFailure behavior.
Note: dataIntake.kafka.properties configure the inbound Data Intake Kafka consumer. They do not configure outbound DMP publishing.